package arsmodeller.part;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.editparts.AbstractGraphicalEditPart;

import arsmodeller.model.BusinessProcess;
import arsmodeller.model.Employee;
import arsmodeller.model.MainModel;
import arsmodeller.model.Service;

public class AppEditPartFactory implements EditPartFactory {
	@Override
	public EditPart createEditPart(EditPart context, Object model) {
		AbstractGraphicalEditPart part = null;
		if (model instanceof MainModel) {
			part = new EnterprisePart();
		} else if (model instanceof Service) {
			part = new ServicePart();
		} else if (model instanceof Employee) {
			part = new EmployeePart();
		} else if (model instanceof BusinessProcess) {
			part = new BusinessProcessPart();
		}
		part.setModel(model);
		return part;
	}
}
